package io;

import java.io.*;
import java.nio.charset.StandardCharsets;

public class BrDemo {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("pw.txt");
        InputStreamReader isr =new InputStreamReader(fis, StandardCharsets.UTF_8);
        BufferedReader br = new BufferedReader(isr);
        /*
        String readline():读取一行字符串，返回的字符串中不包含最后的换行符
        如果单独读取到了换行符(一个空行)则返回值为空字符串("")
        如果返回值为null，则表示读到了末尾
         */
        String line;
        while ((line= br.readLine())!=null){
            System.out.println(line);
//            System.out.print(line);没有换行操作
        }
        br.close();
    }
}
